<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<c:if test="${empty param.include}">
	<%@ include file="/common/meta.jsp"%>
</c:if>
<link href="${res}/css/information.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${res}/js/jquery/jquery.js"></script>
<script type="text/javascript">
	function nTabs(thisObj, Num) {
		if (thisObj.className == "active")
			return;
		var tabObj = thisObj.parentNode.id;
		var tabList = document.getElementById(tabObj)
				.getElementsByTagName("li");
		for (i = 0; i < tabList.length; i++) {
			if (i == Num) {
				thisObj.className = "active";
				document.getElementById(tabObj + "_Content" + i).style.display = "block";
			} else {
				tabList[i].className = "normal";
				document.getElementById(tabObj + "_Content" + i).style.display = "none";
			}
		}
	}
</script>
<script type="text/javascript">
  $(function(){
	  var orgcode = $("#orglist").val();
	  
	  //取出疑似理由信息
	  $("#spn_reason").html($("#spn_reason_"+orgcode).html());
	  //取出第一个单位的名称
	  $("#showFirstOrg").text($("#firstOrg").text());
	  //取出第二个单位的名称
	  $("#showSecOrg").text($("#secOrg_"+orgcode).text());
	  //先隐藏所有。
	  $("div[id^=org_]").each(function(){
		  $(this).hide();
	  });
	  $("#org_"+orgcode).show();
	  
	 $("table[name^=prporg_]").each(function(){
		  $(this).hide();
	  });
	  $("table[name='prporg_"+orgcode+"']").show(); 
	  
	  
  });
  function sd(){
	  var pro_num = $("input[name='pro_num']").val();
	  var sim_pro_num = $("input[name='sim_pro_num']").val();
	  
  }
  
  function showOrgInfo(){
	  var orgcode = $("#orglist").val();
	  //先隐藏所有。
	  $("div[id^=org_]").each(function(){
		  $(this).hide();
	  });
	  $("#org_"+orgcode).show();
	  //取出第二个单位的名称
	  $("#showSecOrg").text($("#secOrg_"+orgcode).text());	  
	  //取出疑似理由信息
	  $("#spn_reason").html($("#spn_reason_"+orgcode).html());	  
	  
	  $("table[name^='prporg_']").each(function(){
		  $(this).hide();
	  });
	  $("table[name='prporg_"+orgcode+"']").show(); 
	  
  }
  
</script>

</head>

<body>
	<!-- <div class="pop_win" style="width:970px;"> -->
	<!-- <div class="win_title"><a href="#" class="btn_close" title="关闭窗口"></a>疑似单位详情</div>-->
	<div class="win_main">
	    <div align="right" style="padding-bottom:5px;padding-right:10px;">
				<select id="orglist" class="" onchange="showOrgInfo()" <c:if test="${fn:length(orglist)==2 }">style="display:none"</c:if>>
				<c:forEach var="list" items="${orglist }" varStatus="varStatus">
		        <c:choose>
				<c:when test="${not varStatus.first}">
				<c:set var="xmlData" value="${list.prpOrg.familiarOrgDetail}" />
			    <x:parse xml="${xmlData}" var="xmlData" />
					<option value="${list.prpOrg.familiarOrgCode}"><x:out select="$xmlData/data/organization/org_name" escapeXml="false"/></option>
				 </c:when>
				 </c:choose>
				 </c:forEach>
				</select>		
	    </div>
		<div class="detail_tit">
			<div class="tit_01"><span id="showFirstOrg"></span></div>
			<div class="tit_02"><span id="showSecOrg"></span></div>
			<div class="clear"></div>
		</div>
		<div class="detail_box">
			<div class="reason">
				疑似理由：
				<div id="spn_reason">
				</div>
			</div>
			<c:set value="1" var="index1" scope="page" />
			<c:forEach var="list" items="${orglist }" varStatus="varStatus">
				<c:choose>
					<c:when test="${varStatus.first}">
						<c:set var="org1" value="${list}" />
						<c:set var="xmlstr" value="${org1.xmlDate}" />
						<x:parse xml="${xmlstr}" var="xmlData" />
						<span id="firstOrg" style="display: none;"><x:out select="$xmlData/data/organization/org_name" escapeXml="false"/></span>
						<div class="project_box01">
							<div class="project_analysis_two" id="project_box_one">
								<table class="t_css" width="100%" border="0" cellpadding="0"
									cellspacing="1">
									<tr class="t_tr">
										<td colspan="4">单位基本信息</td>
									</tr>
									<tr class="li_1">
										<td width="30%" align="right">单位名称：</td>
										<td colspan="3" align="left"><span><x:out
													select="$xmlData/data/organization/org_name"
													escapeXml="false" /></span></td>
									</tr>
									<tr class="li_2">
										<td align="right">组织机构代码：</td>
										<td colspan="3" align="left"><x:out
												select="$xmlData/data/organization/org_no" escapeXml="false" /></td>
									</tr>
									<tr class="li_1">
										<td align="right">单位地址：</td>
										<td colspan="3" align="left" nowrap="nowrap"><x:out
												select="$xmlData/data/organization/address"
												escapeXml="false" /></td>
									</tr>
								</table>
								
								<div class="t_bar" style="margin-top: 15px;font-size:12px;">单位人员信息</div>
								<c:set value="0" var="index" scope="page" />
								<x:forEach select="$xmlData/data/persons/person" var="person">
									<c:choose>
										<c:when test="${index==0}">
											<c:set value="法定代表人" var="flag" scope="page" />
										</c:when>
										<c:otherwise>
											<c:set value="单位负责人" var="flag" scope="page" />
										</c:otherwise>
									</c:choose>
									<c:choose>
										<c:when test="${index%2==0 }">
											<c:set value="li_1" var="trClass" scope="page" />
										</c:when>
										<c:otherwise>
											<c:set value="li_2" var="trClass" scope="page" />
										</c:otherwise>
									</c:choose>

									<table class="t_css" width="100%" border="0" cellpadding="0"
										cellspacing="1">
										<tr class="t_tr">
											<td colspan="4">${flag } <span class="tit_03">(<x:out
														select="$person/id_type_name" escapeXml="false" />：<x:out
														select="$person/id_no" escapeXml="false" />)
											</span></td>
										</tr>
										<tr class="li_1">
											<td width="25%" align="right">姓名：</td>
											<td width="25%" align="left"><x:out
													select="$person/cname" escapeXml="false" /></td>
											<td width="25%" align="right">学历：</td>
											<td align="left"><x:out
													select="$person/educate_background_name" escapeXml="false" /></td>
										</tr>
										<tr class="li_2">
											<td align="right">手机：</td>
											<td align="left"><x:out select="$person/mobile"
													escapeXml="false" /></td>
											<td align="right">电话：</td>
											<td align="left"><x:out select="$person/tel"
													escapeXml="false" /></td>
										</tr>
										<tr class="li_1">
											<td width="25%" align="right">职务：</td>
											<td width="25%" align="left"><x:out
													select="$person/position" escapeXml="false" /></td>
											<td width="25%" align="right">职称：</td>
											<td align="left"><x:out select="$person/prof_title_name"
													escapeXml="false" /></td>
										</tr>
									</table>

									<c:set value="${index+1 }" var="index" scope="page" />
								</x:forEach>								
								
								<div class="t_bar" style="margin-top: 15px;font-size:12px;">主要股东/出资人信息（前5名）</div>

								<c:set value="0" var="index" scope="page" />
								<c:set value="" var="trClass" scope="page" />
								<x:forEach select="$xmlData/data/shareholders/shareholder" 
								var="shareholder">
									<table width="100%" border="0" cellpadding="0" cellspacing="1"
										class="t_css">
										<tr class="t_tr">
											<td colspan="4"><x:out select="$shareholder/cname"
													escapeXml="false" /><span class="tit_03">(<x:out select="$shareholder/card_type_name" escapeXml="false"/>：<x:out
														select="$shareholder/card_code" escapeXml="false" />)
											</span></td>
										</tr>
										<tr class="li_1">
											<td width="25%" align="right">出资额：</td>
											<td width="25%" align="left"><x:out
													select="$shareholder/invest_amount" escapeXml="false" />万元</td>
											<td width="25%" align="right">出资方式：</td>
											<td align="left"><x:out
													select="$shareholder/invest_type_name" escapeXml="false" /></td>
										</tr>
										<tr class="li_2">
											<td align="right">出资比例：</td>
											<td align="left"><x:out
													select="$shareholder/invest_percent" escapeXml="false" /></td>
											<td align="right">入股时间：</td>
											<td align="left"><x:out
													select="$shareholder/buy_stock_date" escapeXml="false" /></td>
										</tr>
									</table>
									<c:set value="${index+1}" var="index" scope="page" />
								</x:forEach>
								
								<!-- 判断是否循环了五次，如果没有则补充空的table -->
								<c:if test="${index < 5 }">
								     <c:forEach begin="${index+1 }" end="5">
											<table width="100%" border="0" cellpadding="0" cellspacing="1"
												class="t_css">
												<tr class="t_tr">
													<td colspan="4">&nbsp;
													</span></td>
												</tr>
												<tr class="li_1">
													<td width="25%" align="right">&nbsp;</td>
													<td width="25%" align="left">&nbsp;</td>
													<td width="25%" align="right">&nbsp;</td>
													<td align="left">&nbsp;</td>
												</tr>
												<tr class="li_2">
													<td align="right">&nbsp;</td>
													<td align="left">&nbsp;</td>
													<td align="right">&nbsp;</td>
													<td align="left">&nbsp;</td>
												</tr>
											</table>								       
								     </c:forEach>
								</c:if>

								<div class="t_bar" style="margin-top: 15px;font-size:12px;" id="pro_list">项目列表</div>
									     <!-- 先列出第一个的不为空的项目 -->		  
										<c:set value="1" var="index" scope="page" />
										<c:forEach var="prp" items="${org1.prpList }"
											varStatus="varStatus">
											<table class="t_css" width="100%" border="0" cellpadding="0"
												cellspacing="1">
												<tr class="t_tr">
													<td colspan="4" nowrap="nowrap"><span class="tit_03">${prp.zhTitle}</span></td>
												</tr>
												<tr class="li_1">
													<td width="25%" align="right" nowrap="nowrap">年度：</td>
													<td align="left" nowrap="nowrap">${prp.statYear}</td>
													<td width="25%" align="right" nowrap="nowrap">项目类别：</td>
													<td align="left" nowrap="nowrap">${prp.grantName}</td>
												</tr>
												<tr class="li_2">
													<td width="25%" align="right" nowrap="nowrap">主管部门：</td>
													<td align="left" nowrap="nowrap">${prp.officeOrgName}</td>
													<td align="right" nowrap="nowrap">立项情况：</td>
													<td align="left" nowrap="nowrap">${prp.zh_cn_caption}</td>							
												</tr>
												<tr class="li_1">
													<td width="25%" align="right" nowrap="nowrap">开始时间：</td>
													<td align="left" nowrap="nowrap"><fmt:formatDate value="${prp.startDate}" pattern="yyyy-MM-dd" /></td>
													<td width="25%" align="right" nowrap="nowrap">结束时间：</td>
													<td align="left" nowrap="nowrap"><fmt:formatDate value="${prp.endDate}" pattern="yyyy-MM-dd" /></td>							
												</tr>
											</table>
											<c:set value="${index + 1}" var="index" scope="page" />
										</c:forEach>									
								
								<c:forEach var="orgc" items="${orglist }" varStatus="varStatus">
		     						<c:choose>
									<c:when test="${not varStatus.first}">
								 <c:forEach var="item" varStatus="status"  begin="${fn:length(org1.prpList)+1 }" end="${fn:length(orgc.prpList) }">
				      	   		<!-- 用于填充为空白的table -->
				      	   		<table name="prporg_${orgc.prpOrg.familiarOrgCode}" class="t_css" width="100%" border="0" cellpadding="0"
											cellspacing="1" >
											<tr class="t_tr">
												<td colspan="4"><span class="tit_03">&nbsp;</span></td>
											</tr>
											<tr class="li_1">
												<td width="25%" align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>
												<td width="25%" align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>
											</tr>
											<tr class="li_2">
												<td width="25%" align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>
												<td width="25%"  align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>							
											</tr>
											<tr class="li_1">
												<td width="25%" align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>
												<td width="25%" align="right">&nbsp;</td>
												<td align="left">&nbsp;</td>							
											</tr>
							    	</table>
							    	</c:forEach>
								    	
								    	
								    	
								    	
					      	  		 </c:when>
					      	  		 </c:choose>
					      	   </c:forEach>
								
									
							</div>
						</div>
					</c:when>
				</c:choose>
				<c:set var="index1" value="${index1 + 1 }" scope="page"></c:set>
			</c:forEach>
			
			<div class="project_box02">
			  <c:forEach var="list" items="${orglist }" varStatus="varStatus">
		     <c:choose>
				<c:when test="${not varStatus.first}">
				<c:set var="xmlData" value="${list.prpOrg.familiarOrgDetail}" />
			    <x:parse xml="${xmlData}" var="xmlData" />
			    <div  id="spn_reason_${list.prpOrg.familiarOrgCode}"  class="showReason"  style="display:none">
			     <!-- 疑似理由 -->
			      	<c:forEach var="prpOrg" items="${fn:split(list.prpOrg.resultDesc,';') }">
				    ${prpOrg }<br/>
				</c:forEach>
			    </div>
			    <span id="secOrg_${list.prpOrg.familiarOrgCode}" style="display: none;"><x:out select="$xmlData/data/organization/org_name" escapeXml="false"/></span>
				<div class="project_analysis_two"  id="org_${list.prpOrg.familiarOrgCode}" style="display: none;">
					<table class="t_css" width="100%" border="0" cellpadding="0"
						cellspacing="1">
						<tr class="t_tr">
							<td colspan="4">单位基本信息</td>
						</tr>
						<tr class="li_1">
							<td width="30%" align="right">单位名称：</td>
							<td colspan="3" align="left"><span ><x:out select="$xmlData/data/organization/org_name" escapeXml="false"/></span></td>
						</tr>
						<tr class="li_2">
							<td align="right">组织机构代码：</td>
							<td colspan="3" align="left"><x:out select="$xmlData/data/organization/org_no" escapeXml="false"/></td>
						</tr>
						<tr class="li_1">
							<td align="right">单位地址：</td>
							<td colspan="3" align="left" nowrap="nowrap"><x:out select="$xmlData/data/organization/address" escapeXml="false"/></td>
						</tr>
					</table>
					
			<div class="t_bar" style="margin-top: 15px;font-size:12px;">单位人员信息</div>
					
	         <c:set value="0" var="index" scope="page" />
		         <c:set value="li_1" var="trClass" scope="page" />
				 <x:forEach select="$xmlData/data/persons/person" var="person">
					<c:choose>
						<c:when test="${index==0}">
							<c:set value="法定代表人" var="flag" scope="page" />
						</c:when>
						<c:otherwise>
							<c:set value="单位负责人" var="flag" scope="page" />
						</c:otherwise>
					</c:choose>
					<c:choose>
						<c:when test="${index%2==0 }"><c:set value="li_1" var="trClass" scope="page"/></c:when>
						<c:otherwise><c:set value="li_2" var="trClass" scope="page"/></c:otherwise>
					</c:choose>					
					<table class="t_css" width="100%" border="0" cellpadding="0"
						cellspacing="1">
						<tr class="t_tr">
							<td colspan="4">${flag } <span class="tit_03">(<x:out select="$person/id_type_name" escapeXml="false"/>：<x:out select="$person/id_no" escapeXml="false"/>)</span></td>
						</tr>
						<tr class="li_1">
							<td width="25%" align="right">姓名：</td>
							<td width="25%" align="left"><x:out select="$person/cname" escapeXml="false"/></td>
							<td width="25%" align="right">学历：</td>
							<td align="left"><x:out select="$person/educate_background_name" escapeXml="false"/></td>
						</tr>
						<tr class="li_2">
							<td align="right">手机：</td>
							<td align="left"><x:out select="$person/mobile" escapeXml="false"/></td>
							<td align="right">电话：</td>
							<td align="left"><x:out select="$person/tel" escapeXml="false"/></td>
						</tr>
						<tr class="li_1">
							<td width="25%" align="right">职务：</td>
							<td width="25%" align="left"><x:out select="$person/position" escapeXml="false"/></td>
							<td width="25%" align="right">职称：</td>
							<td align="left"><x:out select="$person/prof_title_name" escapeXml="false"/></td>
						</tr>
					</table>
					<c:set value="${index+1 }" var="index" scope="page" />
				</x:forEach>					
					
					<div class="t_bar" style="margin-top: 15px;font-size:12px;">主要股东/出资人信息（前5名）</div>
					
	      	    <c:set value="0" var="index" scope="page" />
				<c:set value="" var="trClass" scope="page"/>
				<x:forEach select="$xmlData/data/shareholders/shareholder" var="shareholder">					
					<table class="t_css" width="100%" border="0" cellpadding="0"
						cellspacing="1">
						<tr class="t_tr">
							<td colspan="4"><x:out select="$shareholder/cname" escapeXml="false"/><span class="tit_03">(<x:out select="$shareholder/card_type_name" escapeXml="false"/>：<x:out select="$shareholder/card_code" escapeXml="false"/>)</span></td>
						</tr>
						<tr class="li_1">
							<td width="25%" align="right">出资额：</td>
							<td width="25%" align="left"><x:out select="$shareholder/invest_amount" escapeXml="false"/>万元</td>
							<td width="25%" align="right">出资方式：</td>
							<td align="left"><x:out select="$shareholder/invest_type_name" escapeXml="false"/></td>
						</tr>
						<tr class="li_2">
							<td align="right">出资比例：</td>
							<td align="left"><x:out select="$shareholder/invest_percent" escapeXml="false"/></td>
							<td align="right">入股时间：</td>
							<td align="left"><x:out select="$shareholder/buy_stock_date" escapeXml="false"/></td>
						</tr>
					</table>
		    	 <c:set value="${index+1}" var="index" scope="page" />
			  	</x:forEach>		
			 
	
				<!-- 判断是否循环了五次，如果没有则补充空的table -->
				<c:if test="${index < 5 }">
				     <c:forEach begin="${index+1 }" end="5">
							<table width="100%" border="0" cellpadding="0" cellspacing="1"
								class="t_css">
								<tr class="t_tr">
									<td colspan="4">&nbsp;
									</span></td>
								</tr>
								<tr class="li_1">
									<td width="25%" align="right">&nbsp;</td>
									<td width="25%" align="left">&nbsp;</td>
									<td width="25%" align="right">&nbsp;</td>
									<td align="left">&nbsp;</td>
								</tr>
								<tr class="li_2">
									<td align="right">&nbsp;</td>
									<td align="left">&nbsp;</td>
									<td align="right">&nbsp;</td>
									<td align="left">&nbsp;</td>
								</tr>
							</table>								       
				     </c:forEach>
				</c:if>
			  				
					<div class="t_bar" style="margin-top: 15px;font-size:12px;">项目列表</div>
		      	     
								<c:set value="1" var="index" scope="page"/>
					         	<c:forEach var="prp" items="${list.prpList }" varStatus="varStatus">
								<table class="t_css" width="100%" border="0" cellpadding="0"
									cellspacing="1">
									<tr class="t_tr">
										<td colspan="4" nowrap="nowrap"><span class="tit_03">${prp.zhTitle}</span></td>
									</tr>
									<tr class="li_1">
										<td width="25%" align="right" nowrap="nowrap">年度：</td>
										<td align="left" nowrap="nowrap">${prp.statYear}</td>
										<td width="25%" align="right" nowrap="nowrap">项目类别：</td>
										<td align="left" nowrap="nowrap">${prp.grantName}</td>
									</tr>
									<tr class="li_2">
										<td width="25%" align="right" nowrap="nowrap">主管部门：</td>
										<td align="left" nowrap="nowrap">${prp.officeOrgName}</td>
										<td width="25%"  align="right" nowrap="nowrap">立项情况：</td>
										<td align="left" nowrap="nowrap">${prp.zh_cn_caption}</td>							
									</tr>
									<tr class="li_1">
										<td width="25%" align="right" nowrap="nowrap">开始时间：</td>
										<td align="left" nowrap="nowrap"><fmt:formatDate value="${list.startDate}" pattern="yyyy-MM-dd" /></td>
										<td width="25%" align="right" nowrap="nowrap">结束时间：</td>
										<td align="left" nowrap="nowrap"><fmt:formatDate value="${list.endDate}" pattern="yyyy-MM-dd" /></td>							
									</tr>
								</table>
					         <c:set value="${index + 1}" var="index" scope="page"/>
					      	</c:forEach>			      	     
		      	     
			      	     <c:forEach var="item" varStatus="status"   begin="${fn:length(list.prpList)+1}" end="${fn:length(org1.prpList)}">
						      	   		<!-- 用于填充为空白的table -->
						      	   		<table name="prporg_${list.prpOrg.familiarOrgCode}" class="t_css" width="100%" border="0" cellpadding="0"
													cellspacing="1" >
													<tr class="t_tr">
														<td colspan="4"><span class="tit_03">&nbsp;</span></td>
													</tr>
													<tr class="li_1">
														<td width="25%" align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>
														<td width="25%" align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>
													</tr>
													<tr class="li_2">
														<td width="25%" align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>
														<td width="25%"  align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>							
													</tr>
													<tr class="li_1">
														<td width="25%" align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>
														<td width="25%" align="right">&nbsp;</td>
														<td align="left">&nbsp;</td>							
													</tr>
									    	</table>
								</c:forEach>
								
								
				</div>
				</c:when>
				</c:choose>
				</c:forEach>
			</div>
			<div class="clear" style="height: 0px; overflow: hidden;"></div>
		</div>
	</div>
	<!--
</div>
-->
</body>
</html>
